var findtype;
$.ajaxSetup({
    headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')}
});
function  changetab(e) {
    $(e).siblings().removeAttr('class');//去除同级元素的class
    $(e).attr('class','active');
    findtype = $(e).val();
    $.ajax({
        type: 'get',
        url: '/xrtab',
        data: {typeid: findtype},
        success: function (res) {
            if (res)
            {
                $(".change_tab").html(res)
            }
        }
    });
}

/**
 * 首页查询所有寻人消息
 * @param e
 */
function allfind(e) {
    $(e).siblings().removeAttr('class');//去除同级元素的class
    $(e).attr('class','active');
    $.ajax({
        type: 'get',
        url: '/xrtab',
        data: {typeid: 'all'},
        success: function (res) {
            if (res)
            {
                $(".change_tab").html(res)
            }
        }
    });
}
/**
 * 首页查询所有寻人消息
 * @param e
 */
function allfind(e) {
    $(e).siblings().removeAttr('class');//去除同级元素的class
    $(e).attr('class','active');
    $.ajax({
        type: 'get',
        url: '/xrtab',
        data: {typeid: 'all'},
        success: function (res) {
            if (res)
            {
                $(".change_tab").html(res)
            }
        }
    });
}
/**
 * 切换城市
 * @param a
 */
function changecity(a)
{
    //获取当前城市编号
    var city_code = $(a).attr("value");
    //种下cookie
    $.cookie('citycode', city_code);
    window.location.reload()

}
$(function () {
    $("#find_data").click(function () {
        var search_name = $("#search_name").val()
        if (search_name != '') {
            window.open("http://kevin.wb.cc/xrdt/t0?search_text=" + search_name);
        }
    })
})
var swiper = new Swiper('.swiper-container', {
    spaceBetween: 30,
    centeredSlides: true,
    autoplay: {
        delay: 2500,
        disableOnInteraction: false,
    },
    loop:true,
    pagination: {
        el: '.swiper-pagination',
        clickable: true,
    },
    navigation: {
        nextEl: '.swiper-button-next',
        prevEl: '.swiper-button-prev',
    },
});